package com.lin.fengxiu.vo;

import com.lin.fengxiu.model.Activity;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import org.springframework.beans.BeanUtils;
import org.springframework.util.CollectionUtils;

import javax.persistence.Id;
import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;

/**
 * @ClassName Activity
 * @Description TODO  活动、优惠券关系
 * @Author wushaopei
 * @Date 2021/3/23 22:39
 * @Version 1.0
 */
@Setter
@Getter
public class ActivityCouponVO extends ActivityPureVO{
    private List<CouponPureVO> coupons;

    public ActivityCouponVO(Activity activity){
        super(activity);
        coupons = activity.getCouponList()
                .stream().map(CouponPureVO::new)
                .collect(Collectors.toList());
    }
}
